/**
 * 
 */
package org.extdev.libraries.ltr;

/**
 * @author LAP
 *
 */
public class LTR212ExceptionGenerator implements LTR212APIConstants {
	
	public static void throwLTRException(int exceptionNo) throws LTRException {
		LTRExceptionGenerator.throwLTRException(exceptionNo);
		switch(exceptionNo) {
		case LTR212_ERR_CANT_WRITE_SERIAL_NUM: throw new LTRException("Cant write serial number", LTR212_ERR_CANT_WRITE_SERIAL_NUM);
		case LTR212_ERR_INVALID_SLOT_NUM: throw new LTRException("Invalid slot number", LTR212_ERR_INVALID_SLOT_NUM);
		case LTR212_ERR_CANT_SEND_COMMAND: throw new LTRException("Cant send command", LTR212_ERR_CANT_SEND_COMMAND);
		case LTR212_ERR_CANT_WRITE_EEPROM: throw new LTRException("cant write EEPROM", LTR212_ERR_CANT_WRITE_EEPROM);
		case LTR212_ERR_ERROR_OVERFLOW: throw new LTRException("Some owerflow", LTR212_ERR_ERROR_OVERFLOW);
		case LTR212_ERR_PARITY_ERROR: throw new LTRException("parity error", LTR212_ERR_PARITY_ERROR);
		case LTR212_ERR_CANT_LOAD_BIOS: throw new LTRException("cant load bios", LTR212_ERR_CANT_LOAD_BIOS);
		case LTR212_ERR_CANT_USE_CALIBR_MODE: throw new LTRException("cant use calibrate mode", LTR212_ERR_CANT_USE_CALIBR_MODE);
		case LTR212_ERR_CANT_GET_DATA: throw new LTRException("cant get data", LTR212_ERR_CANT_GET_DATA);
		case LTR212_ERR_INV_ADC_DATA: throw new LTRException("invalid ADC data or cant get frame", LTR212_ERR_INV_ADC_DATA); //LTR212_ERR_CANT_GET_FRAME: ;
		case LTR212_ERR_TEST_NOT_PASSED: throw new LTRException("Test not passed", LTR212_ERR_TEST_NOT_PASSED);
		case LTR212_ERR_CANT_INIT: throw new LTRException("cant initilize", LTR212_ERR_CANT_INIT);
		case LTR212_ERR_CANT_LOAD_FIR: throw new LTRException("cant load FIR", LTR212_ERR_CANT_LOAD_FIR);
		case TIMEOUT_CMD_SEND: throw new LTRException("Time is out (for send or recive)", TIMEOUT_CMD_SEND);
		case LTR212_ERR_CANT_GET_DATE: throw new LTRException("cant get date", LTR212_ERR_CANT_GET_DATE);
		case LTR212_ERR_WRONG_FLASH_CRC: throw new LTRException("wrong flash CRC", LTR212_ERR_WRONG_FLASH_CRC);
		case LTR212_ERR_CANT_START_INTERFACE_TEST: throw new LTRException("cant start interface test", LTR212_ERR_CANT_START_INTERFACE_TEST);
		case LTR212_ERR_INVALID_ACQ_MODE: throw new LTRException("invalid ACQ mode", LTR212_ERR_INVALID_ACQ_MODE);
		case LTR212_ERR_CANT_READ_REG: throw new LTRException("cant read register", LTR212_ERR_CANT_READ_REG);
		case LTR212_ERR_CANT_RESET_CODECS: throw new LTRException("cant reset codecs", LTR212_ERR_CANT_RESET_CODECS);
		case LTR212_ERR_WRONG_BIOS_FILE: throw new LTRException("wrong bios file", LTR212_ERR_WRONG_BIOS_FILE);
		case LTR212_ERR_WRONG_SN: throw new LTRException("wrong serial number", LTR212_ERR_WRONG_SN);
		case LTR212_ERR_CANT_RESET_MODULE: throw new LTRException("cant reset module", LTR212_ERR_CANT_RESET_MODULE);
		case LTR212_ERR_INVALID_DESCR: throw new LTRException("invalide describe", LTR212_ERR_INVALID_DESCR);
		case LTR212_ERR_CANT_OPEN_CHANNEL: throw new LTRException("cant open channel", LTR212_ERR_CANT_OPEN_CHANNEL);
		case LTR212_ERR_CANT_MANAGE_FILTERS: throw new LTRException("cant manage filters", LTR212_ERR_CANT_MANAGE_FILTERS);
		case LTR212_ERR_WRONG_ADC_SETTINGS: throw new LTRException("wrong ADC settings", LTR212_ERR_WRONG_ADC_SETTINGS);
		case LTR212_ERR_CANT_CLOSE: throw new LTRException("cant close", LTR212_ERR_CANT_CLOSE);
		case LTR212_ERR_CANT_LOAD_CLB_COEFFS: throw new LTRException("cant load calibrate coefficients", LTR212_ERR_CANT_LOAD_CLB_COEFFS);
		case LTR212_ERR_CANT_LOAD_FABRIC_CLB_COEFFS: throw new LTRException("cant load fabric calibrate coefficients", LTR212_ERR_CANT_LOAD_FABRIC_CLB_COEFFS);
		case LTR212_ERR_CANT_CALIBRATE: throw new LTRException("cant calibrate", LTR212_ERR_CANT_CALIBRATE);
		case LTR212_ERR_CANT_GET_VER: throw new LTRException("cant get version", LTR212_ERR_CANT_GET_VER);
		case LTR212_ERR_CANT_SET_ADC: throw new LTRException("cant set ADC", LTR212_ERR_CANT_SET_ADC);
		case LTR212_ERR_CANT_USE_FABRIC_AND_USER_CALIBR_SYM: throw new LTRException("cant use calibrate summ", LTR212_ERR_CANT_USE_FABRIC_AND_USER_CALIBR_SYM);
		case LTR212_ERR_CANT_STOP: throw new LTRException("cant stop", LTR212_ERR_CANT_STOP);
		case LTR212_ERR_WRONG_VCH_SETTINGS: throw new LTRException("wrong virtual channel settings", LTR212_ERR_WRONG_VCH_SETTINGS);
		case LTR212_ERR_CANT_WRITE_REG: throw new LTRException("cant write register", LTR212_ERR_CANT_WRITE_REG);
		case LTR212_ERR_INVALID_CRATE_SN: throw new LTRException("invalid crate serial number", LTR212_ERR_INVALID_CRATE_SN);
		case LTR212_ERR_CANT_READ_EEPROM: throw new LTRException("cant read EEPROM", LTR212_ERR_CANT_READ_EEPROM);
		case LTR212_ERR_CANT_START_ADC: throw new LTRException("cant start ADC", LTR212_ERR_CANT_START_ADC);
		case LTR212_ERR_CANT_EVAL_DAC: throw new LTRException("cant evaluate DAC", LTR212_ERR_CANT_EVAL_DAC);
		case LTR212_ERR_CANT_SELECT_CODEC: throw new LTRException("cant select codec", LTR212_ERR_CANT_SELECT_CODEC);
		case LTR212_ERR_MODULE_NO_RESPONCE: throw new LTRException("module no responce", LTR212_ERR_MODULE_NO_RESPONCE);
		}
	}
}
